package presentation.data;

import java.awt.Component;

import javax.swing.JOptionPane;

public class MessagesUtil {
	public static final String GENERAL_ERR_MSG = 
		"An error has occurred that prevents further processing.";
	public static final String SELECT_ROW_MSG =
		"Please select a row.";
	public static final String NOT_AUTHORIZED =
		"You are not authorized to access this page.";
	public static final String DATABASE_ERROR =
		"A database error has occurred. Please try again later.";
	public static void displayErrorMsg(Component c, String msg) {
		JOptionPane.showMessageDialog(c,         									          
				  msg,
				  "Error", 
				  JOptionPane.ERROR_MESSAGE);
	}
	
	public static void displayInfoMsg(Component c, String msg) {
		JOptionPane.showMessageDialog(c,         									          
				  msg,
				  "Info", 
				  JOptionPane.INFORMATION_MESSAGE);
	}
	
	public static void displayPlainMessage(Component c, String msg, String title) {
		JOptionPane.showMessageDialog(c, msg,
				title, JOptionPane.PLAIN_MESSAGE);
	}
}
